package com.wpl.service.impl;

import com.wpl.bean.User;
import com.wpl.bean.UserExample;
import com.wpl.dao.UserMapper;
import com.wpl.service.IServingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 是否服务
 */
@Service
public class ServingserviceImpl implements IServingService {

    @Resource
    private UserMapper userMapper;

    /**
     * 服务状态改变
     * @param user
     * @param username
     * @return
     */
    @Override
    public int changeServing(User user, String username) {
        UserExample userExample = new UserExample();
        UserExample.Criteria criteria = userExample.createCriteria();
        criteria.andUsernameEqualTo(username);
        return userMapper.updateByExampleSelective(user,userExample);
    }
}
